package com.potato.network.bean;

import android.os.Parcelable;

import com.potato.network.exception.ApiException;

import java.util.ArrayList;

import io.reactivex.functions.Function;

public class HttpResultFuncList <T extends Parcelable> implements Function<BaseListEntity<T>, ArrayList<T>> {

    @Override
    public ArrayList<T> apply(BaseListEntity<T> entity) throws Exception {
        if (entity.code!=200){
            throw new ApiException(entity.code,entity.message);
        }
        return entity.getT();
    }

}
